import 'package:flutterlib/model/post/comment_bean.dart';
import 'package:json_annotation/json_annotation.dart';

part 'comment_bean_tree.g.dart';


@JsonSerializable()
class CommentBeanTree extends Object {

  @JsonKey(name: 'comment_count')
  int commentCount;

  @JsonKey(name: 'content')
  List<CommentBean> content;

  @JsonKey(name: 'first')
  bool first;

  @JsonKey(name: 'last')
  bool last;

  @JsonKey(name: 'number')
  int number;

  @JsonKey(name: 'number_of_elements')
  int numberOfElements;

  @JsonKey(name: 'pageable')
  Pageable pageable;

  @JsonKey(name: 'size')
  int size;

  @JsonKey(name: 'sort')
  Sort sort;

  @JsonKey(name: 'total_elements')
  int totalElements;

  @JsonKey(name: 'total_pages')
  int totalPages;

  CommentBeanTree(this.commentCount,this.content,this.first,this.last,this.number,this.numberOfElements,this.pageable,this.size,this.sort,this.totalElements,this.totalPages,);

  factory CommentBeanTree.fromJson(Map<String, dynamic> srcJson) => _$CommentBeanTreeFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CommentBeanTreeToJson(this);

}





@JsonSerializable()
class Pageable extends Object {

  @JsonKey(name: 'offset')
  int offset;

  @JsonKey(name: 'page_number')
  int pageNumber;

  @JsonKey(name: 'page_size')
  int pageSize;

  @JsonKey(name: 'paged')
  bool paged;

  @JsonKey(name: 'sort')
  Sort sort;

  @JsonKey(name: 'unpaged')
  bool unpaged;

  Pageable(this.offset,this.pageNumber,this.pageSize,this.paged,this.sort,this.unpaged,);

  factory Pageable.fromJson(Map<String, dynamic> srcJson) => _$PageableFromJson(srcJson);

  Map<String, dynamic> toJson() => _$PageableToJson(this);

}


@JsonSerializable()
class Sort extends Object {

  @JsonKey(name: 'sorted')
  bool sorted;

  @JsonKey(name: 'unsorted')
  bool unsorted;

  Sort(this.sorted,this.unsorted,);

  factory Sort.fromJson(Map<String, dynamic> srcJson) => _$SortFromJson(srcJson);

  Map<String, dynamic> toJson() => _$SortToJson(this);

}


